Content starts here Creating the Physical Data Service for the LDAP Sample
This page last changed on Jun 19, 2008.

edocs Home > BEA AquaLogic Data Services Platform 3.0/3.2 Documentation > ALDSP 3.2 New Features Documentation

How To Create the Physical Data Service for the LDAP Sample

This topic describes how to create a physical data service based on the LDAP sample application.

Topic Map

Supporting LDAP Server Entries Through Data Services

Installing the ALDSP Retail Dataspace Sample

  1. If it is not already running, launch Studio.
  2. If you have not already done so, install the ALDSP Retail Dataspace Sample. The sample creates a dataspace for retail data services that connects to a relational database and web services.
    Depending on whether your are running WebLogic server 10.1 or 9.2 see:

Importing JAR Files

Two separate import operations into the Retail Dataspace project are needed.

Import Source Contents
Spring LDAP 1.2.1 JAR Basic LDAP support classes.
ldap_java.jar Java functions needed by the new physical data service.

If you have not already done so, unzip the project ZIP file LdapJavaDsp32.zip into a temporary directory. The project files are located in the LdapJavaDsp32 directory.

Importing Spring LDAP JAR Files 

To import the Spring LDAP JAR files which were included with the LDAP sample:

  1. Expand the Retail Dataspace project and locate the DSP-INF/lib folder.

    Project Explorer - DSP-INF/lib Folder

  2. Right-click the DSP-INF/lib folder and choose Import.
  3. Select General > File System and click Next.
    Import Source Dialog

  4. For the From directory field click Browse, select the LdapJavaDsp32/lib folder, and click OK.

    Importing the Spring LDAP JAR Files

  5. Click the checkbox next to lib to select all JAR files in the library; then click Finish. The wizard imports the selected JAR files.

Importing the ldap_java.jar File

The ldap_java.jar file contains Java functions for your new physical data service.

To import the ldap_java.jar file:

  1. Right-click the DSP-INF/lib folder and choose Import.
  2. Select General > File System, then Next.
  3. For the From directory field click Browse, select the LdapJavaDsp32/dist folder, and click OK.

    Importing the ldap_java.jar File

  4. Click the checkbox next to dist, then click Finish. The wizard imports the ldap_java.jar file.

Creating the Physical Data Service

You need to create the physical data service that uses Java functions to facilitate data access.

You can inspect the Java functions; they are in the DspLdapWrapper.java file.

To create the physical data service:

  1. In the Project Explorer right-click RetailDataspace/Physical, and choose New > Physical Data Service.

    Creating a New Physical Data Service

  2. Choose Java Function from the Data source type drop-down list.
  3. Click Browse next to the Class name field. The Open Java Class dialog appears.
  4. Navigate to:
    ldap_java/com/example/ldap/DspLdapWrapper.class
  5. Click Open.
    Open Java Class

  6. Click Next.
  7. Select all functions except:
    {{main(java.lang.String)}}
  8. Select the updatePersonSDO() function
  9. Select the With Change Summary checkbox.

    Select Java Function

  10. Click Next.
  11. Configure the settings in the Review New/Updated Data Service Operation(s) step, as shown in the following table:
    Operation Public Kind Primary
    updatePersonXMLBean Yes
    Update
    updatePersonSDO Yes
    Update
    deletePerson Yes
    Delete Yes
    createPerson Yes
    Create Yes
    getPersonByUserId Yes
    Read
    getAllPersons Yes
    Read


    Review New/Updated Data Service Operation(s)

  12. Click Next.
  13. Type a Data Service Name, such as:
    LDAPdsp
  14. Click Finish.

Update the Procedure Declaration 

The procedure declaration generated by the New Physical Data Service Wizard needs to be modified.

This step is a workaround for CR365986 in the import wizard. Once you make these code changes to correctly list inetOrgPerson it will work correctly and will treat the function as a primary update procedure.
 
To update the procedure declaration: 

  1. Double-click the data service in the Project Explorer.
  2. Click the Source tab.
  3. Update the pragma of the updatePersonSDO() procedure to set the operation as primary, as shown in the following:
    <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="update" isPrimary="true" nativeName="updatePersonSDO">
  4. Update the declaration for the updatePersonSDO() procedure to match the following (make sure the namespace prefix matches your source):
    declare procedure f1:updatePersonSDO($x1 as changed-element(t1:inetOrgPerson)*) as empty() external;
  5. Choose File > Save from the main menu.
  6. Redeploy the project.

You can now perform create, read, update and delete (CRUD) operations against an LDAP server. For example, in Test view you can run the getAllPersons() operation.

Testing the getAllPersons() LDAP Operation 

You can also optionally create new logical data services that combine this physical data service with other data services, such as RDBMS, Web Services, and so on.

Next Step

Related Topics

Concepts
How Tos
Document generated by Confluence on Jun 23, 2008 11:27